const { ipcMain } = require("electron/main");

module.exports = (win) => {
  ipcMain.on("close-window", (e) => {
    // 关闭窗口
    win.close();
  });
  ipcMain.on("min-window", (e) => {
    // 最小化窗口
    win.minimize();
  });
  ipcMain.on("max-window", (e) => {
    // 最大化窗口
    if (win.isMaximized()) {
      win.unmaximize();
    } else {
      win.maximize();
    }
  });
};
